home *** CD-ROM | disk | FTP | other *** search
- "Tabby_Launch"
-
- ' COMMENTS
- ' Last Modified, by Michael Lininger on 12-22-89.
-
- ' This sub-routine reads in the launch.next file from the disk and
- ' determines the next application to be launched. If it is not the last
- ' application in the chain a new launch.next file is written to the
- ' disk for the next application to use, after it has been launched.
- ' If it is the last application in the chain then the launch.next file
- ' is deleted from the disk.
- ' This routine is over-kill and can be simplified.
-
- ' ----- End Comment
-
- RESET: ' Make sure all file are closed
- EventCount%=0: ' sets the number of events in launch.next to 0
- ErrCode%=3: ' sets Export error code (03 deals with Launch.next)
- ERROR = 0: ' sets ERROR bit to Zero/No error has occured
- LErr% = 1: ' tell ERROR_Check that we are in the tabby_launch area
-
- ' Make sure a Lunch.next file exists
- ON ERROR GOSUB 65535: ' We do our own error trapping
- OPEN "R",1,NextLaunch$
- Length&=LOF(1,1)
- CLOSE #1
-
- ' If Launch.next file does not exist then jump to Launch_RRH Routine
- LONG IF Length&=0
- ErrLine$ = "<<Warning 01>> *"+NextLaunch$+"* Does not exist at end of Indicated Path! "
- GOSUB "Error Log"
- KILL NextLaunch$
- GOTO "Launch_RRH"
- END IF
-
- ' Read in event chain into Tabby$()
- OPEN "I",1,NextLaunch$
- WHILE NOT EOF(1)
- GOSUB "Cursor_Spin"
- INPUT #1,Tabby$(EventCount%)
- EventCount%=EventCount%+1
- WEND
- CLOSE #1
-
- ' If ERROR <> 0 then there was a problem with reading the Launch.next file
- IF ERROR <> 0 THEN GOSUB "ERROR_Check"
-
- GOSUB "Cursor_Spin"
- EventCount%=EventCount%-1
- ERROR = 0: ' sets ERROR bit to Zero/No error has occured
-
- ' If EventCount% = 0 then this is the last event, delete Launch.next file
- ' Else write Launch.next file back to disk, minus the first event which
- ' is going to be launched next.
- LONG IF EventCount% < 1
- ErrCode%=4: ' sets Export error code (Launch.next Delete)
- KILL NextLaunch$
- XELSE
- ErrCode%=5: ' sets Export error code (New lanuch.next Creation)
- OPEN "O",1,NextLaunch$
- FOR Count% = 1 TO EventCount%
- PRINT #1,Tabby$(Count%);
- GOSUB "Cursor_Spin"
- LONG IF Tabby$(Count%+1) = ""
- PRINT #1,CHR$(13);
- XELSE
- PRINT #1,",";
- END IF
- NEXT Count%
- CLOSE #1
- END IF
-
- ' If ERROR <> 0 then there was a problem writing/deleting launch.next file
- IF ERROR <> 0 THEN GOSUB "ERROR_Check"
-
- ' Add BBS path to application to be launched
- ' If the Next Event = "BBS" then next file to launch to Red Ryder Host RRHost$
- LaunchFile$=BBSPath$+Tabby$(0)
- IF UCASE$(Tabby$(0)) = "BBS" THEN LaunchFile$=RRHost$
-
-
- ERROR = 0: ' sets ERROR bit to Zero/No error has occured
- ErrCode%=6: ' sets Export error code (06 deals with next launch application)
-
- ' Checks to see if LaunchFile exists
- OPEN "I",2,LaunchFile$
- CLOSE #2
- ' If it does exist then launch it
- LONG IF ERROR = 0 THEN
- RUN LaunchFile$
- END: ' A must if you run under MultiFinder
- END IF
- ErrLine$ = "<<ERROR"+STR$(ERROR)+">> *"+LaunchFile$+"* Does not exist at end of Indicated Path! "
- GOSUB "Error Log"
-
- "Launch_RRH"
-
- ERROR = 0: ' sets ERROR bit to Zero/No error has occured
- ErrCode%=7: ' sets Export error code (07 deals with launching RRHost/SS
-
- ' Checks to see if RRHost exists
- OPEN "I",2,RRHost$
- CLOSE #2
- ' If it does exist then launch it
- LONG IF ERROR = 0
- RUN RRHost$
- END: ' a must if you run under MultiFinder
- END IF
-
- ' last chance, RRHost launch failed, drop to finder
- ErrLine$ = "<<ERROR"+STR$(ERROR)+">> *"+RRHost$+"* Does not exist at end of Indicated Path! "
- GOSUB "Error Log"
- END
-
- RETURN
-
-
-
- "ERROR_Check"
-
- GOSUB "Error Log"
- ' LErr% is a multi-purpose flag, used by various routines
- ' If it is set to 1 then that means the error occurred in the
- ' Tabby_Launch routine it set and there is no way to recover
- ' Except to attempt to run RRHOST and END.
- LONG IF LErr%=1
- RUN RRHost$
- END: ' A must if you run under MultiFinder
- END IF
- GOSUB "Tabby_Launch"
- END
-
- RETURN
-
-
- "Error Log"
-
- ' Writes a text file, listing the Error that happended
- ErrHold%=ERROR
- DEF OPEN "TEXTEDIT"
- OPEN "A",9,"Application.Error"
- ErrLine$="<<ERROR"+STR$(Errhold%)+","+STR$(ErrCode%)+">> internal application problem "+TIME$+" "+DATE$
- PRINT #9,ErrLine$
- CLOSE #9
- RETURN
-
-
-
-
-
-
-